//
//  YNShareItemView.m
//  YNClientProject
//
//  Created by 雅恩三河科技 on 2018/11/23.
//  Copyright © 2018年 雅恩三河科技. All rights reserved.
//

#import "YNShareItemView.h"
#import "Head.h"
@interface YNShareItemView ()

@end

@implementation YNShareItemView
#pragma mark - getter and setter
#pragma mark - event
#pragma mark - method
#pragma mark - life
-(instancetype)init
{
    if (self = [super init]) {
        self.backgroundColor=[UIColor whiteColor];
        self.width=SCREEN_WIDTH;
        self.height=WFCGFloatY(160);
        @WeakSelf;
        for (int i=0; i<2; i++)
        {
            UIButton* btn=[UIButton buttonWithType:UIButtonTypeCustom];
            btn.width=WFCGFloatX(45);
            btn.height=WFCGFloatX(45);
            [btn setBackgroundImage:[UIImage imageNamed:i==0?@"share_wchat":@"share_wcircle"] forState:UIControlStateNormal];
            btn.y=WFCGFloatY(25);
            btn.x=i==0?WFCGFloatX(60):SCREEN_WIDTH-WFCGFloatX(105);
            [self addSubview:btn];
            
            [btn handleControlEvent:UIControlEventTouchUpInside withBlock:^{
                selfp.handler(i);
            }];
            UILabel* titleLab=[UILabel new];
            titleLab.x=i==0?WFCGFloatX(60):SCREEN_WIDTH-WFCGFloatX(105);
            titleLab.y=WFCGFloatY(35)+WFCGFloatX(45);
            titleLab.width=WFCGFloatX(45);
            titleLab.height=WFCGFloatY(15);
            titleLab.textColor=HEXCOLOR(@"#333333");
            titleLab.font=SYSTEMFONT(14);
            titleLab.textAlignment=NSTextAlignmentCenter;
            titleLab.text=i==0?@"微信":@"朋友圈";
            [selfp addSubview:titleLab];
        }
        
        UIButton* btn=[UIButton buttonWithType:UIButtonTypeCustom];
        btn.width=SCREEN_WIDTH;
        btn.height=WFCGFloatY(45);
        [btn setTitle:@"取消" forState:UIControlStateNormal];
        btn.y=self.height-WFCGFloatY(45);
        btn.x=0;
        [btn setTitleColor:HEXCOLOR(@"#333333") forState:UIControlStateNormal];
        btn.titleLabel.font=SYSTEMFONT(15);
        [self addSubview:btn];
        [btn handleControlEvent:UIControlEventTouchUpInside withBlock:^{
            selfp.handler(9);
        }];
        
        
        UIImageView* lineIV=[UIImageView new];
        lineIV.width=SCREEN_WIDTH;
        lineIV.height=0.5;
        lineIV.x=0;
        lineIV.y=self.height-WFCGFloatY(45);
        lineIV.backgroundColor=Main_Color_BG;
        [self addSubview:lineIV];
        
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
#pragma mark - delegate
@end
